package cn.hou.java.designpattern._08flyweight;

public class Test01 {
	public static void main(String[] args) {
		StudentFactory stu=new StudentFactory();
		//获取共享数据
		Student student = stu.getStudent("0001");
		System.out.println(student);
		System.out.println(stu.getStudent("0002"));
		System.out.println(stu.getStudent("0003"));
		System.out.println(student==stu.getStudent("0001"));//true,获取到的是同一个数据
	}
}
